<html>
<head>
<title>
Command line HSDB
</title>
</head>
<body>

<h1>Command line HSDB</h1>
<p>
When debugging remote core dumps it is easier to work with command line tools instead of
GUI tools. Command line HSDB (CLHSDB) tool is alternative to SA GUI tool HSDB.
CLHSDB is launched from the command line using the "jhsdb clhsdb" command.
</p>

<p>
CLHSDB supports Unix shell-like (or dbx/gdb-like) command line interface with
support for output redirection/appending (familiar &gt;, &gt;&gt;), command history and so on.
Each CLHSDB command can have zero or more arguments and optionally end with output redirection
(or append) to a file. Commands may be stored in a file and run using <b>source</b> command.
<b>help</b> command prints usage message for all supported commands (or a specific command)
</p>

<h3>Annotated output of CLHSDB help command</h3>

<pre>
<code>
Available commands:
  assert true | false <font color="red">turn on/off asserts in SA code</font>
  attach pid | exec core | debugserver  <font color="red">attach SA to a process, core, or remote debug server</font>
  buildreplayjars [all | boot | app] <font color="red">build jars for replay, boot.jar for bootclasses, app.jar for application classes</font>
  class name <font color="red">find a Java class from debuggee and print oop</font>
  classes <font color="red">print all loaded Java classes with Klass*</font>
  detach <font color="red">detach SA from current target</font>
  dis address [ length ]  <font color="red">disassemble (requires hsdis) specified number of instructions from given address</font>
  dissemble address <font color="red">disassemble nmethod</font>
  dumpcfg -a | id <font color="red">Dump the PhaseCFG for every compiler thread that has one live</font>
  dumpclass { address | name } [ directory ] <font color="red">dump .class file for given Klass* or class name</font>
  dumpcodecache <font color="red">dump codecache contents</font>
  dumpheap [ file ] <font color="red">dump heap in hprof binary format</font>
  echo [ true | false ] <font color="red">turn on/off command echo mode</font>
  examine { address[/count] | address,address } <font color="red">show contents of memory range</font>
  field [ type [ name fieldtype isStatic offset address ] ] <font color="red">print info about a field of HotSpot type</font>
  findpc address <font color="red">print info about pointer location</font>
  findsym name <font color="red">print address of symbol in the executable or shared library</font>
  flags [ flag ] <font color="red">show all -XX flag name value pairs. or just show given flag</font>
  help [ command ] <font color="red">print help message for all commands or just given command</font>
  history <font color="red">show command history. usual !command-number syntax works.</font>
  inspect expression <font color="red">inspect a given oop</font>
  intConstant [ name [ value ] ] <font color="red">print out hotspot integer constant(s)</font>
  jdis address <font color="red">show bytecode disassembly of a given Method*</font>
  jhisto <font color="red">show Java heap histogram</font>
  jstack [-v] [-l] <font color="red">show Java stack trace of all Java threads. -v is verbose mode. -l includes info on owned java.util.concurrent locks.</font>
  livenmethods <font color="red">show all live nmethods</font>
  longConstant [ name [ value ] ] <font color="red">print out hotspot long constant(s)s</font>
  mem [ -v ] { address[/count] | address,address } <font color="red">show contents of memory range. -v adds "findpc" info for addresses</font>
  pmap <font color="red">show Solaris pmap-like output</font>
  print expression <font color="red">print given Klass*, Method* or arbitrary address</font>
  printas type expression <font color="red">print given address as given HotSpot type. eg. print JavaThread &lt;address&gt;</font>
  printmdo -a | expression <font color="red">print method data oop</font>
  printstatics [ type ] <font color="red">print static fields of given HotSpot type (or all types if none specified)</font>
  pstack [-v] [-l] <font color="red">show mixed mode stack trace for all Java, non-Java threads. -v is verbose mode. -l includes info on owned java.util.concurrent locks.</font>
  quit <font color="red">quit CLHSDB tool</font>
  reattach <font color="red">detach and re-attach SA to current target</font>
  revptrs  <font color="red">find liveness of oops</font>
  scanoops start end [ type ] <font color="red">scan a Oop from given start to end address</font>
  search [ heap | codecache | threads ] value <font color="red">search a value in heap or codecache or threads</font>
  source filename <font color="red">load and execute CLHSDB commands from given file</font>
  symbol name <font color="red">show address of a given ELF/COFF symbol</font>
  sysprops <font color="red">show all Java System properties</font>
  thread id <font color="red">show thread of id</font>
  threads <font color="red">show all Java threads</font>
  tokenize ...
  type [ type [ name super isOop isInteger isUnsigned size ] ] <font color="red">show info. on HotSpot type</font>
  universe <font color="red">print gc universe</font>
  vmstructsdump <font color="red">dump hotspot type library in text</font>
  verbose true | false <font color="red">turn on/off verbose mode</font>
  versioncheck [ true | false ] <font color="red">turn on/off debuggee VM version check</font>
  whatis address <font color="red">print info about any arbitrary address. alias for findpc command</font>
  where { -a | id } <font color="red">print Java stack trace of given Java thread or all Java threads (-a)</font>
</code>
</pre>

</body>
</html>
